package com.itHsuSE.demo8;

import javax.swing.*;
import java.awt.*;

/**
 * @author Hsu琛君珩
 * @ClassName:Test11
 * @date 2023-12-19
 * @apiNote
 * @Version: v1.0
 */

public class Test11 {
    public static void main(String[] args) {
        JFrame jf = new JFrame("Frame");
        jf.setLayout((new FlowLayout(FlowLayout.CENTER)));//流布局，居中对齐
        jf.setBounds(400, 300, 300, 400);

        JButton jb1=new JButton("A");
        JButton jb2=new JButton("B");
        JButton jb3=new JButton("C");
        JButton jb4=new JButton("D");
        JButton jb5=new JButton("E");

        jf.add(jb1);
        jf.add(jb2);
        jf.add(jb3);
        jf.add(jb4);
        jf.add(jb5);

        jf.setVisible(true);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
